﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using Automobile.service.BLL;
using Automobile.service.Model;

namespace Automobile.service.UI
{
    public partial class AddShipments : System.Web.UI.Page
    {
        ShipmentsBll bll = new ShipmentsBll();
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            ShipmentsModel s = new ShipmentsModel();           
            s.Shipments_blitems = this.TextBox2.Text.ToString();
            s.Shipments_data = Convert.ToDateTime(this.TextBox3.Text);
            s.Shipments_Per = this.TextBox4.Text.ToString();
            s.Shipments_Por = this.TextBox5.Text.ToString();
            s.Shipments_Peosor = this.TextBox6.Text.ToString();
            s.MemberCard_Id = Convert.ToInt32(this.TextBox7.Text);
            s.WareHose_Id = Convert.ToInt32(this.TextBox8.Text);
            s.Shipments_Price = Convert.ToInt32(this.TextBox9.Text);
            s.Shipments_Pricepor = Convert.ToInt32(this.TextBox10.Text);
            s.Shipments_Remark = this.TextBox11.Text.ToString();
            if (bll.AddShipments(s) > 0)
            {
                Response.Write("<script>alert('添加成功!');location.href='Shipments.aspx';</script>");
            }
            else
            {
                Response.Write("<script>alert('添加失败!');</script>");
            }
        }

        protected void btnBack_Click(object sender, EventArgs e)
        {
            Response.Redirect("Shipments.aspx");
        }
    }
}